<?php
/**
 * Created by PhpStorm.
 * User: qishengqiang
 * Date: 2021-08-30
 * Time: 09:10
 */

namespace app\models;


class Questions extends ModelBase
{
    protected $pk = 'questionId';

    public function category()
    {
        return $this->hasOne(QuestionCategories::class, 'categoryId', 'questionCategoryId');
    }

    public function getStatusText()
    {
        return $this->status == 0?'停用':'启用';
    }

    public function selects()
    {
        return $this->hasMany(QuestionSelects::class, 'questionId', 'questionId');
    }
}